<template>
  <div>
    <el-dialog title="相关文档"
               :visible.sync="dialogTableVisible">

      <el-tabs>
        <el-tab-pane label="指标文档">
          <el-table :data="documentsTableData"
                    border
                    style="width: 100%">
            <el-table-column type="selection"
                             width="55">
            </el-table-column>
            <el-table-column prop="name"
                             label="名称">
            </el-table-column>
            <el-table-column prop="version"
                             label="版本">
            </el-table-column>
            <el-table-column prop="path"
                             label="查看">
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <el-tab-pane label="维修程序"
                     lazy>
          <el-table :data="repairServiceTableData"
                    border
                    style="width: 100%">
            <el-table-column type="selection"
                             width="55">
            </el-table-column>
            <el-table-column prop="name"
                             label="名称">
            </el-table-column>
            <el-table-column prop="version"
                             label="版本">
            </el-table-column>
            <el-table-column prop="path"
                             label="查看">
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <el-tab-pane label="标准文档"
                     lazy>
          <el-table :data="standardTableData"
                    border
                    style="width: 100%">
            <el-table-column type="selection"
                             width="55">
            </el-table-column>
            <el-table-column prop="name"
                             label="名称">
            </el-table-column>
            <el-table-column prop="version"
                             label="版本">
            </el-table-column>
            <el-table-column prop="path"
                             label="查看">
            </el-table-column>
          </el-table>
        </el-tab-pane>
      </el-tabs>
      <div slot="footer"
           class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary"
                   @click="dialogFormVisible = false">确 定</el-button>
      </div>

    </el-dialog>
  </div>

</template>

<script>
import { default as apiList } from '../../apis/wendang';
export default {
    props: {
        id: String,
    },
    data() {
        return {
            documentsTableData: [],
            repairServiceTableData: [],
            standardTableData: [],
            dialogTableVisible: false,
            dialogFormVisible: false,
        };
    },
    created() {
        console.log(this.id, 'idididididididid');
        // 文档;
        this.getListDocuments(), this.getListRepairService(), this.getListStandard();
    },
    methods: {
        ...apiList,
        getListDocuments() {
            this.searchzbwd({ busiId: this.id, sort: 1 }).then(res => {
                this.documentsTableData = res.data;
            });
        },
        /** 查询列表(维修程序) */
        getListRepairService() {
            this.searchzbwd({ busiId: this.id, sort: 2 }).then(res => {
                this.repairServiceTableData = res.data;
            });
        },

        /** 查询列表(标准文档) */
        getListStandard() {
            this.searchzbwd({ busiId: this.id, sort: 3 }).then(res => {
                this.standardTableData = res.data;
            });
        },
    },
};
</script>

<style>
</style>